package cn.nebula.music.domain;

import java.io.Serializable;
import java.sql.Date;
import java.sql.Time;
import java.util.Set;

import org.springframework.context.annotation.Lazy;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(value = {"handler" })
public class Song implements Serializable{

	private static final long serialVersionUID = 1L;
	private Integer id;
	private String name;
	private String resourcePath;
	@DateTimeFormat(pattern = "HH:mm:ss")
	private Time duration;
	private String language;
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date publishTime;
	private Integer heat;
	private Mv mv;
	private Set<Lyrics> lyricses;
	private Set<Album> albums;
	private Set<Singer> singers;
	private Set<Combination> combinations;
	private Set<Classification> classifications;
	private Set<Songlist> songlists;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getResourcePath() {
		return resourcePath;
	}

	public void setResourcePath(String resourcePath) {
		this.resourcePath = resourcePath;
	}

	public Time getDuration() {
		return duration;
	}

	public void setDuration(Time duration) {
		this.duration = duration;
	}

	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	public Date getPublishTime() {
		return publishTime;
	}

	public void setPublishTime(Date publishTime) {
		this.publishTime = publishTime;
	}

	public Integer getHeat() {
		return heat;
	}

	public void setHeat(Integer heat) {
		this.heat = heat;
	}

	public Mv getMv() {
		return mv;
	}

	public void setMv(Mv mv) {
		this.mv = mv;
	}

	public Set<Lyrics> getLyricses() {
		return lyricses;
	}

	public void setLyricses(Set<Lyrics> lyricses) {
		this.lyricses = lyricses;
	}

	public Set<Album> getAlbums() {
		return albums;
	}

	public void setAlbums(Set<Album> albums) {
		this.albums = albums;
	}

	public Set<Singer> getSingers() {
		return singers;
	}

	public void setSingers(Set<Singer> singers) {
		this.singers = singers;
	}

	public Set<Combination> getCombinations() {
		return combinations;
	}

	public void setCombinations(Set<Combination> combinations) {
		this.combinations = combinations;
	}

	public Set<Classification> getClassifications() {
		return classifications;
	}

	public void setClassifications(Set<Classification> classifications) {
		this.classifications = classifications;
	}

	public Set<Songlist> getSonglists() {
		return songlists;
	}

	public void setSonglists(Set<Songlist> songLists) {
		this.songlists = songLists;
	}

	@Override
	public String toString() {
		return "Song [id=" + id + ", name=" + name + ", resourcePath=" + resourcePath + ", duration=" + duration
				+ ", language=" + language + ", publishTime=" + publishTime + ", heat=" + heat + ", mv=" + mv
				+ ", lyricses=" + lyricses + ", albums=" + albums + ", singers=" + singers + ", combinations="
				+ combinations + ", classifications=" + classifications + ", songLists=" + songlists + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((albums == null) ? 0 : albums.hashCode());
		result = prime * result + ((classifications == null) ? 0 : classifications.hashCode());
		result = prime * result + ((combinations == null) ? 0 : combinations.hashCode());
		result = prime * result + ((duration == null) ? 0 : duration.hashCode());
		result = prime * result + ((heat == null) ? 0 : heat.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((language == null) ? 0 : language.hashCode());
		result = prime * result + ((lyricses == null) ? 0 : lyricses.hashCode());
		result = prime * result + ((mv == null) ? 0 : mv.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((publishTime == null) ? 0 : publishTime.hashCode());
		result = prime * result + ((resourcePath == null) ? 0 : resourcePath.hashCode());
		result = prime * result + ((singers == null) ? 0 : singers.hashCode());
		result = prime * result + ((songlists == null) ? 0 : songlists.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Song other = (Song) obj;
		if (albums == null) {
			if (other.albums != null)
				return false;
		} else if (!albums.equals(other.albums))
			return false;
		if (classifications == null) {
			if (other.classifications != null)
				return false;
		} else if (!classifications.equals(other.classifications))
			return false;
		if (combinations == null) {
			if (other.combinations != null)
				return false;
		} else if (!combinations.equals(other.combinations))
			return false;
		if (duration == null) {
			if (other.duration != null)
				return false;
		} else if (!duration.equals(other.duration))
			return false;
		if (heat == null) {
			if (other.heat != null)
				return false;
		} else if (!heat.equals(other.heat))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (language == null) {
			if (other.language != null)
				return false;
		} else if (!language.equals(other.language))
			return false;
		if (lyricses == null) {
			if (other.lyricses != null)
				return false;
		} else if (!lyricses.equals(other.lyricses))
			return false;
		if (mv == null) {
			if (other.mv != null)
				return false;
		} else if (!mv.equals(other.mv))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (publishTime == null) {
			if (other.publishTime != null)
				return false;
		} else if (!publishTime.equals(other.publishTime))
			return false;
		if (resourcePath == null) {
			if (other.resourcePath != null)
				return false;
		} else if (!resourcePath.equals(other.resourcePath))
			return false;
		if (singers == null) {
			if (other.singers != null)
				return false;
		} else if (!singers.equals(other.singers))
			return false;
		if (songlists == null) {
			if (other.songlists != null)
				return false;
		} else if (!songlists.equals(other.songlists))
			return false;
		return true;
	}

	
}
